/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.controller;

import cn.webrx.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.SpringVersion;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>Project: untitled1 - Index
 * <p>Powered By webrx
 * <p>Created By IntelliJ IDEA On 2021-04-13 11:02:54
 * <p>Description :
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 15
 */
@Controller
public class Index {
    @Autowired
    private BookMapper bookdao;
    @RequestMapping("/")
    public String index(){
        //return "index 中文字符串  spring " + SpringVersion.getVersion();
        return "redirect:/info";
    }

    @GetMapping("/info")
    public String info(Model m){
        m.addAttribute("name", "<span style=\"color:red\">李四六</span>");
        m.addAttribute("books", bookdao.query());
        return "info";
    }
}
